package org.wangp.business.order.web.controller

import cn.hutool.core.util.RandomUtil
import org.springframework.web.bind.annotation.*
import org.wangp.business.order.domain.OrderDTO
import org.wangp.business.order.domain.UserDTO
import org.wangp.business.order.service.OrderService
import org.wangp.framework.core.domain.CommonResult
import javax.annotation.Resource

/**
 * @author wangpeng (๑•ᴗ•๑)
 * @since 2021/10/2 4:07
 */
@RestController
@RequestMapping("order")
class OrderController {

	@Resource
	private lateinit var orderService: OrderService

	@PostMapping
	fun addOrder(@RequestBody userDTO: UserDTO):CommonResult<List<OrderDTO>> {
		val orders = arrayListOf<OrderDTO>()
		for (i in 0..10) {
			orders.add(OrderDTO(id = i.toLong(),name = RandomUtil.randomString(10)))
		}
		return CommonResult.success(orders)
	}
}
